package com.attilax.biz.promitcode;

import java.util.ArrayList;

import com.attilax.Closure;
import com.attilax.barcode.barcodeUtil;
import com.attilax.util.numUtil;

public class ChendeuPromit {

	public String start="0614";
	public int Mid_start=15;
	public int Mid_end=20;
	public int Last_start=1;
	public int Last_end=20;
	public String curDir;
	public String rootDir;
	/**
	 * @param args
	 */
	public static void main(String[] args) {
	final ChendeuPromit chendeuPromit = new ChendeuPromit();
	chendeuPromit.rootDir="c:\\prmtCode";
	chendeuPromit.	gene();
	System.out.println("--f");
 	
		
	}
	private void gene() {
		gene(new Closure () {

			@Override
			public Object execute(final Object arg0) throws Exception {
				String[] a=arg0.toString().split(",");
				String dir=a[0];
				final String prmtCode=a[1];
				barcodeUtil.gene_by_list(rootDir+"\\"+dir, new ArrayList<String>(){{
					this.add(prmtCode);
				}});
				return null;
			}
		});
		
	}
	public   void gene(Closure clsr) {
		for(int i=Mid_start;i<=Mid_end;i++)
		{
			 int len = 2;
			String mid=	numUtil.pad0(i, len);
			for(int j=Last_start;j<=Last_end;j++)
			{
				String last=	numUtil.pad0(j, len);
				try {
					clsr.execute(mid+","+start+mid+last);
				} catch (Exception e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				}
			}			

		}
	}

}
